print("Hello, world!")


i = 256*256
print('i 的值为：', i)



#!/usr/bin/python3
 
# Fibonacci series: 斐波纳契数列
# # 两个元素的总和确定了下一个数
# a, b = 0, 1
# while b < 10:
#     print(b)
#     a, b = b, a+b



#!/usr/bin/python3
 
# Fibonacci series: 斐波纳契数列
# 两个元素的总和确定了下一个数
# a, b = 0, 1
# while b < 1000:
#     print(b, end=' ')
# #     a, b = b, a+b



# list = [1,3,4,2,10]
# multilist=[i for i in list if i <5]
# print("multilsit:",multilist)
# print("list:", list)


# dir = {"name":"张三", "age":18,"address":"北京","phone":"123456789"}
# multidir ={k:k*2 for k in dir if k!= "address"}
# print("multidir:",multidir)



# 字典推导式
# a = {x for x in "abcedefghijklmnopqrstuvwxyz" if x not in "aeiou"}
# print("a:", a)



# a = (x for x in "abcedefghijklmnopqrstuvwxyz" if x not in "aeiou")
# b = [x for x in "abcedefghijklmnopqrstuvwxyz" if x not in "aeiou"]
# print("a:", tuple(a))
# print("b:", b)
# print(type(a))
# print(type(b))


#!/usr/bin/python3
 
# import sys         # 引入 sys 模块
 
# list=[1,2,3,4]
# it = iter(list)    # 创建迭代器对象
 
# while True:
#     try:
#         print (next(it))
#     except StopIteration:
#         sys.exit()


# class MyNumbers:
#   def __iter__(self):
#     self.a = 1
#     return self
 
#   def __next__(self):
#     if self.a <= 20:
#       x = self.a
#       self.a += 1
#       return x
#     else:
#       raise StopIteration
 
# myclass = MyNumbers()
# myiter = iter(myclass)
 
# for x in myiter:
#   print(x)



# a=[x for x in range(100) if x% 2 == 1]
# b=iter(a)
# while(True):
#     try:
#         print(next(b))
#     except StopIteration:
#         break
# # print("Hello, world!")


#!/usr/bin/python3
 
import sys
 
# def fibonacci(n): # 生成器函数 - 斐波那契
#     a, b, counter = 0, 1, 0
#     while True:
#         if (counter > n): 
#             return
#         yield a
#         a, b = b, a + b
#         counter += 1
# f = fibonacci(10) # f 是一个迭代器，由生成器返回生成
 
# while True:
#     try:
#         print (next(f), end=" ")
#     except StopIteration:
#         sys.exit()



# def fib(n):
#     a, b = 0, 1
#     while True:
#         if a> n:
#             return
#         yield a
#         a, b = b, a + b
# b=fib(1000)
# while True:
#     try:
#         print(next(b), end=' ')
#     except StopIteration:
#         break


# print(range(10))
# print(type(range(10)))



# # 同时打开多个文件
# with open('input.txt', 'r') as infile, open('output.txt', 'w') as outfile:
#     content = infile.read()
#     outfile.write(content.upper())
# # outfile.write(content.upper()) 



#!/usr/bin/python3
 
# # 计算面积函数
# def area(width, height):
#     return width * height
 
# def print_welcome(name):
#     print("Welcome", name)
 
# print_welcome("Runoob")
# w = 4
# h = 5
# print("width =", w, " height =", h, " area =", area(w, h))


#!/usr/bin/python3
 
# # 定义函数
# def printme( str ):
#    # 打印任何传入的字符串
#    print (str)
#    return
 
# # 调用函数
# printme("我要调用用户自定义函数!")
# # printme("再次调用同一函数")


# def change(a):
#     print(id(a))   # 指向的是同一个对象
#     a=10
#     print(id(a))   # 一个新对象
 
# a=1
# print(id(a))
# change(a)



# #!/usr/bin/python3
 
# # 可写函数说明
# def changeme( mylist ):
#    "修改传入的列表"
#    mylist.append([1,2,3,4])
#    print ("函数内取值: ", mylist)
#    return
 
# # 调用changeme函数
# mylist = [10,20,30]
# changeme( mylist )
# print ("函数外取值: ", mylist)


#!/usr/bin/python3
 
#可写函数说明
def printinfo( name, age = 35 ):
   "打印任何传入的字符串"
   print ("名字: ", name)
   print ("年龄: ", age)
   return
 
#调用printinfo函数
printinfo( age=50, name="runoob" )
print ("------------------------")
printinfo( name="runoob" )